﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Dynamic;
using EzDesk.Apps.ServiceImpl.ProjectModule.History;

namespace EzDesk.ServiceHost.Controllers
{
    public partial class ProjectController
    {

        #region [ page methods ]
        public ActionResult ProjectHistory(Guid id)
        {
            dynamic result = new ExpandoObject();

            result.ProjectId = id;
            return View(result);
        }
        #endregion

        #region [ ajax methods ]

        [HttpGet]
        public JsonResult ProjectHistoryList(Guid projectId, int startIndex = 0, int count = 20)
        {
            return Json(
                _historyManager.Get(projectId, startIndex, count), 
                JsonRequestBehavior.AllowGet
                );
        }

        #endregion
    }
}
